package ddd1;

import java.lang.StringBuilder;
import java.util.Stack;

public class work7 {
    public static void main(String[] args) {
        int i = 2;
        int j = 3;
        int k = 4;
        int m = 5;
        int n = 6;
        int x = 15;
        System.out.println(letTo2(i));
        System.out.println(letTo2(j));
        System.out.println(letTo2(k));
        System.out.println(letTo2(m));
        System.out.println(letTo2(n));
        System.out.println(letTo2(x));
    }
    public static String letTo2 (int s) {
        int m = 0;
        StringBuilder str = new StringBuilder();
        while(s > 0) {
            m = s % 2;
            s = s / 2;
            str.insert(0, m);
        }
        return str.toString();
    }
}
